<template>
  <div class="app-container">
    <!-- 面包屑导航 -->
    <div class="breadcrumb-container card-shadow-1">
      <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
        <el-breadcrumb-item>首页</el-breadcrumb-item>
        <el-breadcrumb-item>管理中心</el-breadcrumb-item>
        <el-breadcrumb-item>合作商管理</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    
    <!-- 页面标题 -->
    <div class="page-header">
      <h2 class="page-title">合作商管理</h2>
      <p class="page-subtitle">管理系统中的合作商信息，包括添加、修改、删除和查看详情等操作</p>
    </div>
    
    <!-- 美化后的搜索区域 -->
    <div class="search-container">
      <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px" class="search-form">
        <el-form-item label="合作商名称" prop="partnerName" class="search-form-item">
          <el-input
            v-model="queryParams.partnerName"
            placeholder="请输入合作商名称"
            clearable
            @keyup.enter="handleQuery"
            class="search-input"
          />
        </el-form-item>
        <el-form-item class="search-button-group">
          <el-button type="primary" icon="Search" @click="handleQuery" class="search-btn">搜索</el-button>
          <el-button icon="Refresh" @click="resetQuery" class="reset-btn">重置</el-button>
        </el-form-item>
      </el-form>
      
      <!-- 美化后的操作按钮区域 -->
      <el-row :gutter="10" class="mb8 operation-buttons">
        <el-col :span="1.5">
          <el-button
            type="primary"
            icon="Plus"
            @click="handleAdd"
            v-hasPermi="['manage:partner:add']"
            class="operation-btn add-btn"
          >新增</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="success"
            icon="Edit"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['manage:partner:edit']"
            class="operation-btn edit-btn"
          >修改</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="danger"
            icon="Delete"
            :disabled="multiple"
            @click="handleDelete"
            v-hasPermi="['manage:partner:remove']"
            class="operation-btn delete-btn"
          >删除</el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="warning"
            icon="Download"
            @click="handleExport"
            v-hasPermi="['manage:partner:export']"
            class="operation-btn export-btn"
          >导出</el-button>
        </el-col>
        <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>
    </div>

    <div class="table-container card-shadow-2 card-hover-effect">
      <el-table 
        v-loading="loading" 
        :data="partnerList" 
        @selection-change="handleSelectionChange"
        :row-class-name="tableRowClassName"
        class="partner-table"
      stripe
      border
      style="width: 100%"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="序号" type="index" width="50" align="center" prop="id" />
      <el-table-column label="合作商名称" align="center" prop="partnerName" />
      <el-table-column label="点位数" align="center" prop="nodeCount" />
      <el-table-column label="分成比例" align="center" prop="shareRatio" >
        <template #default="scope">
          {{ scope.row.shareRatio }}%
        </template>
      </el-table-column>
      <el-table-column label="账号" align="center" prop="account" />
      <el-table-column label="联系人" align="center" prop="contactPerson" />
      <el-table-column label="联系电话" align="center" prop="contactPhone" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-button link type="primary" size="small" @click="resetPwd(scope.row)" v-hasPermi="['manage:partner:edit']">修改密码</el-button>
          <el-button link type="primary" size="small" @click="handleGetparentInfo(scope.row)" v-hasPermi="['manage:partner:list']">查看详情</el-button>
          <el-button link type="primary" size="small" @click="handleUpdate(scope.row)" v-hasPermi="['manage:partner:edit']">修改</el-button>
          <el-button link type="primary" size="small" @click="handleDelete(scope.row)" v-hasPermi="['manage:partner:remove']">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    </div>
    
    <div class="pagination-container">
      <pagination
        v-show="total>0"
        :total="total"
        v-model:page="queryParams.pageNum"
        v-model:limit="queryParams.pageSize"
        @pagination="getList"
      />
    </div>

    <!-- 添加或修改合作商管理对话框 -->
    <el-dialog :title="title" v-model="open" width="500px" append-to-body class="partner-dialog">
      <el-form ref="partnerRef" :model="form" :rules="rules" label-width="100px" class="partner-form">
        <el-form-item label="合作商名称" prop="partnerName" class="partner-form-item">
          <el-input v-model="form.partnerName" placeholder="请输入合作商名称" class="partner-input" />
        </el-form-item>
        <el-form-item label="联系人" prop="contactPerson" class="partner-form-item">
          <el-input v-model="form.contactPerson" placeholder="请输入联系人" class="partner-input" />
        </el-form-item>
        <el-form-item label="联系电话" prop="contactPhone" class="partner-form-item">
          <el-input v-model="form.contactPhone" placeholder="请输入联系电话" class="partner-input" />
        </el-form-item>
        <el-form-item label="创建时间" prop="createTime" v-if="form.id!=null" class="partner-form-item">
          <div class="readonly-field">{{form.createTime}}</div>
        </el-form-item>
        <el-form-item label="分成比例" prop="shareRatio" class="partner-form-item">
          <el-input v-model="form.shareRatio" placeholder="请输入分成比例" class="partner-input" />
        </el-form-item>
        <el-form-item label="账号" prop="account" v-if="form.id==null" class="partner-form-item">
          <el-input v-model="form.account" placeholder="请输入账号" class="partner-input" />
        </el-form-item>
        <el-form-item label="密码"  prop="password" v-if="form.id==null" class="partner-form-item">
          <el-input v-model="form.password" type="password" placeholder="请输入密码" class="partner-input" />
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm" class="dialog-confirm-btn">确 定</el-button>
          <el-button @click="cancel" class="dialog-cancel-btn">取 消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>

  <!-- 查看合作商详情对话框 -->
 <el-dialog title="合作商详情" v-model="partnerInfoOpen" width="500px" append-to-body class="partner-detail-dialog">
  <el-card class="partner-info-card" shadow="hover">
    <div class="info-row">
      <div class="info-item">
        <span class="info-label">合作商名称：</span>
        <span class="info-value single-line">{{ form.partnerName }}</span>
      </div>
      <div class="info-item">
        <span class="info-label">联系人：</span>
        <span class="info-value">{{ form.contactPerson }}</span>
      </div>
    </div>
    <div class="info-row">
      <div class="info-item">
        <span class="info-label">联系电话：</span>
        <span class="info-value">{{ form.contactPhone }}</span>
      </div>
      <div class="info-item">
        <span class="info-label">分成比例：</span>
        <span class="info-value">{{ form.shareRatio }}%</span>
      </div>
    </div>
    <div class="info-row" v-if="form.createTime">
      <div class="info-item">
        <span class="info-label">创建时间：</span>
        <span class="info-value">{{ form.createTime }}</span>
      </div>
      <div class="info-item">
        <span class="info-label">账号：</span>
        <span class="info-value">{{ form.account }}</span>
      </div>
    </div>
  </el-card>
  <template #footer>
    <div class="dialog-footer">
      <el-button @click="partnerInfoOpen = false" class="dialog-close-btn">关 闭</el-button>
    </div>
  </template>
 </el-dialog>
</template>

<script setup name="Partner">
import { listPartner, getPartner, delPartner, addPartner, updatePartner,resetPartnerPassword} from "@/api/manage/partner";

const { proxy } = getCurrentInstance();

const partnerList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");

// 表格行样式类名
function tableRowClassName({row, rowIndex}) {
  return rowIndex % 2 === 1 ? 'table-row-even' : 'table-row-odd';
}

const data = reactive({
  form: {},
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    partnerName: null,
  },
  rules: {
    partnerName: [
      { required: true, message: "合作商名称不能为空", trigger: "blur" }
    ],
    contactPerson: [
      { required: true, message: "联系人不能为空", trigger: "blur" }
    ],
    contactPhone: [
      { required: true, message: "联系电话不能为空", trigger: "blur" }
    ],
    shareRatio: [
      { required: true, message: "分成比例不能为空", trigger: "blur" }
    ],
    account: [
      { required: true, message: "账号不能为空", trigger: "blur" }
    ],
    password: [
      { required: true, message: "密码不能为空", trigger: "blur" }
    ],
  }
});

const { queryParams, form, rules } = toRefs(data);

/** 查询合作商管理列表 */
function getList() {
  loading.value = true;
  listPartner(queryParams.value).then(response => {
    partnerList.value = response.rows;
    total.value = response.total;
    loading.value = false;
  });
}

// 取消按钮
function cancel() {
  open.value = false;
  reset();
}

// 表单重置
function reset() {
  form.value = {
    id: null,
    partnerName: null,
    contactPerson: null,
    contactPhone: null,
    shareRatio: null,
    account: null,
    password: null,
    createTime: null,
    dateTime: null,
    createBy: null,
    updateBy: null,
    remark: null
  };
  proxy.resetForm("partnerRef");
}

/** 搜索按钮操作 */
function handleQuery() {
  queryParams.value.pageNum = 1;
  getList();
}

/** 重置按钮操作 */
function resetQuery() {
  proxy.resetForm("queryRef");
  handleQuery();
}

// 多选框选中数据
function handleSelectionChange(selection) {
  ids.value = selection.map(item => item.id);
  single.value = selection.length != 1;
  multiple.value = !selection.length;
}

/** 新增按钮操作 */
function handleAdd() {
  reset();
  open.value = true;
  title.value = "添加合作商管理";
}

/** 修改按钮操作 */
function handleUpdate(row) {
  reset();
  const _id = row.id || ids.value
  getPartner(_id).then(response => {
    form.value = response.data;
    open.value = true;
    title.value = "修改合作商管理";
  });
}

/** 提交按钮 */
function submitForm() {
  proxy.$refs["partnerRef"].validate(valid => {
    if (valid) {
      if (form.value.id != null) {
        updatePartner(form.value).then(response => {
          proxy.$modal.msgSuccess("修改成功");
          open.value = false;
          getList();
        });
      } else {
        addPartner(form.value).then(response => {
          proxy.$modal.msgSuccess("新增成功");
          open.value = false;
          getList();
        });
      }
    }
  });
}
/** 查看合作商详情 */
const partnerInfoOpen = ref(false);
function handleGetparentInfo(row) {
  reset();
  const _id = row.id || ids.value
  getPartner(_id).then(response => {
    form.value = response.data;
    partnerInfoOpen.value = true;
  });
}

/** 删除按钮操作 */
function handleDelete(row) {
  const _ids = row.id || ids.value;
  proxy.$modal.confirm('是否确认删除合作商管理编号为"' + _ids + '"的数据项？').then(function() {
    return delPartner(_ids);
  }).then(() => {
    getList();
    proxy.$modal.msgSuccess("删除成功");
  }).catch(() => {});
}


/** 重置密码按钮操作 */
function resetPwd(row) {
  const _id = row.id 
  proxy.$modal.confirm('是否确认重置密码？').then(function() {
    return resetPartnerPassword(_id);
  }).then(() => {
    proxy.$modal.msgSuccess("重置密码成功");
  }).catch(() => {});
}

/** 导出按钮操作 */
function handleExport() {
  proxy.download('manage/partner/export', {
    ...queryParams.value
  }, `partner_${new Date().getTime()}.xlsx`)
}

getList();
</script>

<style scoped>
  /* 全局样式重置 */
  * {
    box-sizing: border-box;
  }
  
  /* 页面背景与基础样式 */
  .app-container {
    min-height: 100vh;
    background-color: var(--bg-secondary);
    padding: 24px;
    animation: fadeIn 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* 奢华商务风格 - 色彩系统优化 */
  :root {
    /* 主色调 - 奢华商务蓝 */
    --primary-color: #1890ff;
    --primary-light: #40a9ff;
    --primary-dark: #096dd9;
    
    /* 辅助色 - 奢华金色点缀 */
    --accent-color: #faad14;
    --accent-light: #ffc53d;
    --accent-dark: #d48806;
    
    /* 状态色 */
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #f5222d;
    --info-color: #1890ff;
    
    /* 中性色 - 专业商务灰 */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-tertiary: #f0f2f5;
    
    --border-color: #dcdfe6;
    --border-light: #e4e7ed;
    --border-dark: #c0c4cc;
    
    --text-primary: #303133;
    --text-secondary: #606266;
    --text-tertiary: #909399;
    --text-placeholder: #c0c4cc;
  }
  
  /* 视觉层次感增强 - 卡片阴影样式系统 */
  .card-shadow-1 {
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.1);
  }
  
  .card-shadow-2 {
    box-shadow: 0 4px 16px rgba(24, 144, 255, 0.15);
  }
  
  .card-shadow-3 {
    box-shadow: 0 8px 24px rgba(24, 144, 255, 0.2);
  }
  
  .card-hover-effect {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .card-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
  }
  
  /* 按钮交互反馈增强 */
  .operation-btn,
  .dialog-confirm-btn,
  .dialog-cancel-btn,
  .dialog-close-btn,
  .search-btn,
  .reset-btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  /* 按钮点击效果 - 水波纹效果 */
  .operation-btn:active,
  .dialog-confirm-btn:active,
  .dialog-cancel-btn:active,
  .dialog-close-btn:active,
  .search-btn:active,
  .reset-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
  }
  
  /* 按钮悬停效果增强 */
  .operation-btn:hover,
  .dialog-confirm-btn:hover,
  .dialog-cancel-btn:hover,
  .dialog-close-btn:hover,
  .search-btn:hover,
  .reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  }
  
  /* 按钮加载状态 */
  .operation-btn.is-loading .el-icon,
  .dialog-confirm-btn.is-loading .el-icon,
  .dialog-cancel-btn.is-loading .el-icon,
  .dialog-close-btn.is-loading .el-icon,
  .search-btn.is-loading .el-icon,
  .reset-btn.is-loading .el-icon {
    animation: rotate 1s linear infinite;
  }
  
  @keyframes rotate {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(360deg);
    }
  }
  
  /* 表单输入框聚焦效果增强 */
  .partner-input .el-input__wrapper:focus-within {
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
    transform: translateY(-1px);
    transition: all 0.3s ease;
  }
  
  /* 表单验证实时反馈 */
  .el-form-item.is-error .el-input__wrapper,
  .el-form-item.is-error .el-textarea__wrapper {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 1px var(--error-color) inset;
    animation: shake 0.5s ease-in-out;
  }
  
  .el-form-item.is-success .el-input__wrapper,
  .el-form-item.is-success .el-textarea__wrapper {
    border-color: var(--success-color) !important;
    box-shadow: 0 0 0 1px var(--success-color) inset;
    transition: all 0.3s ease;
  }
  
  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
  }
  
  /* 对话框过渡动画增强 */
  .partner-dialog .el-dialog__wrapper,
  .partner-detail-dialog .el-dialog__wrapper {
    animation: dialogFadeIn 0.3s ease;
    backdrop-filter: blur(3px);
  }
  
  @keyframes dialogFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  .partner-dialog .el-dialog,
  .partner-detail-dialog .el-dialog {
    animation: dialogZoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
  }
  
  @keyframes dialogZoomIn {
    0% { transform: scale(0.7); opacity: 0; }
    70% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
  }
  
  /* 对话框关闭动画 */
  .partner-dialog.fade-leave-active .el-dialog__wrapper,
  .partner-detail-dialog.fade-leave-active .el-dialog__wrapper {
    animation: dialogFadeOut 0.2s ease;
  }
  
  @keyframes dialogFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
  }
  
  .partner-dialog.fade-leave-active .el-dialog,
  .partner-detail-dialog.fade-leave-active .el-dialog {
    animation: dialogZoomOut 0.2s ease;
  }
  
  @keyframes dialogZoomOut {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.9); opacity: 0; }
  }
  
  /* 消息提示动画增强 */
  .el-message {
    animation: messageSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.3s ease;
  }
  
  @keyframes messageSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
  }
  
  /* 消息提示关闭动画 */
  .el-message-fade-leave-active {
    animation: messageSlideOut 0.3s ease;
  }
  
  @keyframes messageSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
  }
  
  /* 复选框交互反馈增强 */
  .el-checkbox__input.is-checked .el-checkbox__inner {
    animation: checkboxChecked 0.2s ease;
  }
  
  @keyframes checkboxChecked {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
  }
  
  .el-checkbox__input:hover .el-checkbox__inner {
    border-color: var(--primary-color);
    transform: scale(1.05);
    transition: all 0.3s ease;
  }
  
  /* 骨架屏加载动画增强 */
  @keyframes skeleton-loading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
  }
  
  .skeleton-loading {
    background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 50%, #f2f2f2 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
  }
  
  /* 数据加载状态过渡效果 */
  .el-loading-mask {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    transition: all 0.3s ease;
  }
  
  .el-loading-spinner .el-loading-text {
    color: var(--primary-color);
  }
  
  .el-loading-spinner .path {
    stroke: var(--primary-color);
    stroke-width: 3px;
    animation: loading-dash 1.5s ease-in-out infinite;
  }
  
  @keyframes loading-dash {
    0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 89, 200; stroke-dashoffset: -35px; }
    100% { stroke-dasharray: 89, 200; stroke-dashoffset: -124px; }
  }
  
  /* 页面头部设计 - 增强视觉层次 */
  .info-row { display: flex; margin-bottom: 16px; }
  .info-item { flex: 1; display: flex; min-width: 0; }
  .info-label { font-weight: bold; color: #606266; margin-right: 8px; min-width: 80px; white-space: nowrap; }
  .info-value { color: #303133; word-break: break-all; }
  .single-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  
  /* 面包屑和页面标题样式 - 增强视觉层次 */
  .breadcrumb-container {
    background: linear-gradient(135deg, var(--bg-primary) 0%, #f8faff 100%);
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px solid var(--border-light);
  }
  
  .breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 0;
  }
  
  .breadcrumb .el-breadcrumb__item:last-child .el-breadcrumb__inner {
    color: var(--primary-color);
    font-weight: 600;
  }
  
  .page-header {
    background: linear-gradient(135deg, var(--bg-primary) 0%, #f8faff 100%);
    border-radius: 8px;
    padding: 24px 24px 20px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 16px rgba(24, 144, 255, 0.15);
  }
  
  .page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
  }
  
  .page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
  }
  
  /* 搜索区域和操作按钮样式 - 增强视觉层次 */
  .search-container {
    background: linear-gradient(135deg, var(--bg-primary) 0%, #f8faff 100%);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(24, 144, 255, 0.15);
    border: 1px solid var(--border-light);
  }
  
  .search-form {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
  }
  
  .search-form-item {
    margin-bottom: 0;
    flex: 0 0 auto;
  }
  
  .search-input {
    width: 300px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
  }
  
  .search-input:hover {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
  }
  
  .search-button-group {
    display: flex;
    gap: 12px;
    margin-left: auto;
  }
  
  .search-btn, .reset-btn {
    border-radius: 8px;
    padding: 8px 24px;
    transition: all 0.3s ease;
    font-weight: 500;
  }
  
  .search-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-1px);
  }
  
  .reset-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    transform: translateY(-1px);
  }
  
  .operation-buttons {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }
  
  .operation-btn {
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
  }
  
  .add-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-1px);
  }
  
  .edit-btn:hover {
    background-color: var(--success-color);
    border-color: var(--success-color);
    transform: translateY(-1px);
  }
  
  .delete-btn:hover {
    background-color: var(--error-color);
    border-color: var(--error-color);
    transform: translateY(-1px);
  }
  
  .export-btn:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-1px);
  }
  
  /* 数据表格样式 - 增强视觉层次 */
  .table-container {
    background: linear-gradient(135deg, var(--bg-primary) 0%, #f8faff 100%);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-light);
    flex: 1;
    min-height: 0;
  }
  
  .partner-table {
    background-color: transparent;
    border-radius: 8px;
    box-shadow: none;
    overflow: hidden;
    border: 1px solid var(--border-light);
    width: 100%;
  }
  
  /* 表格头部样式 */
  .el-table th {
    background-color: #f0f8ff;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid #e6f7ff;
    padding: 14px 12px;
    position: relative;
  }
  
  /* 表格行样式 */
  .el-table td {
    border-bottom: 1px solid var(--border-light);
    padding: 16px 12px;
    position: relative;
    transition: all 0.3s ease;
  }
  
  /* 斑马纹效果 */
  .el-table__body-wrapper .el-table__body {
    .table-row-even {
      background-color: #fafafa;
    }
    .table-row-odd {
      background-color: #ffffff;
    }
  }
  
  /* 表格行悬停效果增强 */
  .el-table__body-wrapper .el-table__body tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
  }
  
  .el-table__body-wrapper .el-table__body tr:hover {
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
    z-index: 10;
  }
  
  .el-table__body-wrapper .el-table__body tr:hover > td {
    background-color: #e6f7ff !important;
    border-top: 1px solid var(--primary-light);
    border-bottom: 1px solid var(--primary-light);
    transform: translateX(2px);
  }
  
  /* 表格行边框动画 */
  .el-table td {
    position: relative;
    transition: all 0.3s ease;
  }
  
  .el-table td::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background-color: var(--border-light);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
  }
  
  .el-table tbody tr:hover td::after {
    transform: scaleX(1);
    background-color: var(--primary-color);
  }
  
  /* 表格数据加载动画 */
  .table-data-enter {
    animation: countUp 0.5s ease;
  }
  
  /* 行选中效果增强 */
  .el-table__body-wrapper .el-table__body tr.el-table__row--striped.current-row td,
  .el-table__body-wrapper .el-table__body tr.el-table__row--striped.hover-row td,
  .el-table__body-wrapper .el-table__body tr.current-row td,
  .el-table__body-wrapper .el-table__body tr.hover-row td {
    background-color: #bae7ff !important;
    transition: all 0.3s ease;
  }
  
  /* 表格行选中边框效果 */
  .el-table__body-wrapper .el-table__body tr.current-row {
    box-shadow: inset 3px 0 0 0 var(--primary-color);
  }
  
  /* 表格操作按钮样式 */
  .el-button--text {
    font-size: 13px;
    padding: 4px 8px;
    margin: 0 4px;
    color: var(--primary-color);
    transition: all 0.3s ease;
    border-radius: 4px;
  }
  
  .el-button--text:hover {
    color: var(--primary-light);
    background-color: rgba(64, 158, 255, 0.1);
  }
  
  /* 表格加载动画 */
  .el-loading-mask {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
  }
  
  /* 分页样式增强 */
  .pagination-container {
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
  }
  
  .el-pagination {
    margin-top: 0;
    display: flex;
    justify-content: flex-end;
  }
  
  .el-pagination__sizes {
    margin-right: 16px;
  }
  
  /* 分页按钮交互效果 */
  .el-pagination button:hover:not(:disabled) {
    color: var(--primary-color);
    border-color: var(--primary-light);
    transition: all 0.3s ease;
  }
  
  .el-pagination button:not(:disabled).active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
  }
  
  /* 分页跳转输入框交互 */
  .el-pagination__editor .el-input__wrapper:focus-within {
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
    border-color: var(--primary-light);
  }

  /* 添加/修改对话框样式 - 增强视觉层次 */
  .partner-dialog {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(24, 144, 255, 0.2);
  }
  
  .partner-dialog .el-dialog__header {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f7ff 100%);
    padding: 20px 24px;
    border-bottom: 1px solid #e6f7ff;
    position: relative;
  }
  
  .partner-dialog .el-dialog__header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 80px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
  }
  
  .partner-dialog .el-dialog__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
  }
  
  .partner-dialog .el-dialog__body {
    padding: 24px;
  }
  
  .partner-form {
    width: 100%;
  }
  
  .partner-form-item {
    margin-bottom: 24px;
  }
  
  .partner-input {
    width: 100%;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
  }
  
  .partner-input:hover {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
  }
  
  .readonly-field {
    padding: 10px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-tertiary);
    width: 100%;
  }
  
  .dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding: 20px 24px;
    background-color: #fafafa;
    border-top: 1px solid #ebeef5;
  }
  
  .dialog-confirm-btn,
  .dialog-cancel-btn {
    padding: 8px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
  }
  
  .dialog-confirm-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-1px);
  }
  
  .dialog-cancel-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    transform: translateY(-1px);
  }
  
  
  .el-form-item.is-error .el-input__wrapper {
    box-shadow: 0 0 0 1px #f56c6c inset;
  }
  
  .el-form-item.is-success .el-input__wrapper {
    box-shadow: 0 0 0 1px #67c23a inset;
  }

  /* 查看详情对话框样式 - 增强视觉层次 */
  .partner-detail-dialog {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(24, 144, 255, 0.2);
  }
  
  .partner-detail-dialog .el-dialog__header {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f7ff 100%);
    padding: 20px 24px;
    border-bottom: 1px solid #e6f7ff;
    position: relative;
  }
  
  .partner-detail-dialog .el-dialog__header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 80px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
  }
  
  .partner-detail-dialog .el-dialog__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
  }
  
  .partner-detail-dialog .el-dialog__body {
    padding: 24px;
  }
  
  .partner-info-card {
    margin: 0;
    border-radius: 12px;
    border: 1px solid #ebeef5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .partner-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
  }
  
  .info-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .info-row:last-child {
    border-bottom: none;
  }
  
  .info-item {
    flex: 1;
    display: flex;
    min-width: 0;
    margin-bottom: 0;
    align-items: center;
  }
  
  .info-label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 12px;
    min-width: 100px;
    white-space: nowrap;
    font-size: 14px;
  }
  
  .info-value {
    color: var(--text-primary);
    word-break: break-all;
    font-weight: 500;
    font-size: 14px;
  }
  
  .single-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .dialog-close-btn {
    padding: 8px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
  }
  
  .dialog-close-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    transform: translateY(-1px);
  }
  
  
  .el-form-item.is-error .el-input__wrapper {
    box-shadow: 0 0 0 1px #f56c6c inset;
  }
  
  .el-form-item.is-success .el-input__wrapper {
    box-shadow: 0 0 0 1px #67c23a inset;
  }


/* 响应式设计增强 */
  /* 超大屏幕 */
  @media screen and (min-width: 1400px) {
    .app-container {
      padding: 32px;
      gap: 32px;
    }
    
    .page-title {
      font-size: 28px;
    }
    
    .search-container,
    .table-container {
      padding: 32px;
    }
  }
  
  /* 大屏幕 */
  @media screen and (max-width: 1200px) {
    .search-input {
      width: 220px;
    }
    
    .app-container {
      padding: 20px;
      gap: 20px;
    }
  }

/* 中等屏幕 */
  @media screen and (max-width: 992px) {
    .breadcrumb {
      padding: 8px 12px;
    }
    
    .page-header {
      padding-bottom: 12px;
    }
    
    .page-title {
      font-size: 18px;
    }
    
    .page-subtitle {
      font-size: 13px;
    }
    
    .search-container {
      padding: 16px;
    }
    
    .search-input {
      width: 180px;
    }
    
    .operation-buttons {
      margin-top: 16px;
      padding-top: 16px;
    }
    
    .partner-table {
      font-size: 13px;
    }
    
    .el-table td {
      padding: 10px 8px;
    }
    
    .info-item {
      min-width: 200px;
    }
  }

/* 小屏幕 */
  @media screen and (max-width: 768px) {
    .app-container {
      padding: 12px;
      gap: 16px;
    }
    
    .breadcrumb-container,
    .page-header,
    .search-container,
    .table-container {
      border-radius: 8px;
    }
    
    .search-form {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
    }
    
    .search-form-item {
      width: 100%;
      margin-bottom: 12px !important;
    }
    
    .search-input {
      width: 100%;
    }
    
    .search-button-group {
      width: 100%;
      justify-content: space-between;
    }
    
    .operation-buttons {
      display: flex;
      flex-wrap: wrap;
    }
    
    .operation-btn {
      margin-bottom: 8px;
      min-width: 70px;
      flex: 1;
      max-width: calc(50% - 6px);
    }
    
    .partner-table {
      font-size: 12px;
    }
    
    .el-table td {
      padding: 8px 4px;
    }
    
    .el-pagination {
      justify-content: center;
    }
    
    .partner-dialog,
    .partner-detail-dialog {
      width: 95% !important;
      margin: 10px auto;
    }
    
    .info-row {
      flex-direction: column;
    }
    
    .info-item {
      margin-bottom: 8px;
    }
  }

/* 超小屏幕 */
  @media screen and (max-width: 480px) {
    .app-container {
      padding: 8px;
      gap: 12px;
    }
    
    .breadcrumb-container,
    .page-header,
    .search-container,
    .table-container {
      padding: 12px;
      border-radius: 6px;
    }
    
    .page-title {
      font-size: 16px;
    }
    
    .operation-btn {
      min-width: 60px;
      padding: 8px 6px;
      font-size: 12px;
      max-width: 100%;
    }
    
    .el-button--text {
      font-size: 11px;
      padding: 0 2px;
      margin: 0 2px;
    }
    
    .info-label {
      min-width: 80px;
      font-size: 13px;
    }
    
    .info-value {
      font-size: 13px;
    }
  }
  
  /* 平板横屏 */
  @media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .app-container {
      padding: 16px;
      gap: 16px;
    }
    
    .search-input {
      width: 160px;
    }
  }
  
  /* 高分辨率屏幕支持 */
  @media screen and (min-resolution: 2dppx) {
    .el-table th,
    .el-table td {
      position: relative;
    }
    
    .el-table th::after,
    .el-table td::after {
      content: '';
      position: absolute;
      right: 0;
      top: 0;
      height: 100%;
      width: 1px;
      background-color: rgba(0, 0, 0, 0.05);
    }
  }

.el-table {
  .hidden-xs-only {
    @media screen and (max-width: 768px) {
      display: none;
    }
  }
}
</style>
